package com.kelvin.paopao.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.kelvin.kelvinlib.imageloader.GlideUtil;
import com.kelvin.paopao.R;
import com.kelvin.paopao.api.responseBean.DatePersonModel;
import com.kelvin.paopao.api.responseBean.OrderModel;

/**
 * Created by Administrator on 2017/5/11.
 */

public class OrderAdapter extends BaseQuickAdapter<OrderModel, BaseViewHolder> {
    private Context context;

    public OrderAdapter(Context context) {
        super(R.layout.recyclerview_order_item);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, OrderModel item) {
        helper.setText(R.id.tv_good_name, item.getSName());
        helper.setText(R.id.tv_price,"￥"+item.getOprice());
        helper.setText(R.id.tv_number, "共" + item.getONum() + "件商品");
        helper.setText(R.id.tv_money, "合计：￥" + item.getOAllmoney());
        ImageView iv = helper.getView(R.id.iv);
        GlideUtil.loadCommonBG(item.getSImg(), R.drawable.default_img, iv, context);
    }
}
